package com.micro.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.micro.entity.User;
import com.micro.mapper.UserMapper;
import com.micro.service.Uservice;
import org.springframework.stereotype.Service;

/**
 * @author jixia
 * @date 2021/9/27 19:22
 * @description
 */
@Service
public class UserviceImpl extends ServiceImpl<UserMapper, User> implements Uservice {
    @Override
    public User findByUsername(String userName) {
        QueryWrapper<User> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(User::getUsername,userName);
        return this.baseMapper.selectOne(wrapper);
    }
}
